<?php

namespace App\Http\Controllers\home;

use App\Http\Controllers\Controller;
use App\Http\Requests\Replies as RepliesRequest;
use App\Replies as RepliesModel;

class Replies extends Controller
{
    public function add(RepliesRequest $repliesRequest)
    {

        $data   = $repliesRequest->all();
        $result = RepliesModel::insert([
            'nickname'   => $data['nickname'],
            'email'      => $data['email'],
            'content'    => $data['content'],
            'article_id' => $data['article_id'],
        ]);
        return $result ? showSuccess('回复成功！') : showError('网络延迟！');
    }
}
